package com.lb.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.HashMap;
import java.util.Map;

@Mapper
public interface StockMapper {
    @Select("select stock_quantity from products where product_code =#{product_code}  ")
    Map<String, Object> getStockInfo(String product_code);
    @Update("UPDATE products SET stock_quantity = stock_quantity - 1 where product_code = #{productCode} "
            )
    void updateStock(String productCode);
}
